<?php

namespace app\lmsx\validate;
use think\Validate;

/**
 * 文章分类验证
 * @author lan
 */
class Article extends Validate
{
    //定义验证规则
    protected $rule = [
        'title|文章标题'  => 'require|max:30',
        'type_id|文章分类'  => 'require',
        'content|文章内容'  => 'require',

    ];

    //定义验证提示
    protected $message = [
        'title.max' => '文章标题最多不能超过30个字符',
    ];

    //定义验证场景
    protected $scene=[
        'edit'=>['title','content'],
    ];
}
